package com.mls.fivedistrict.pojo;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.mls.fivedistrict.enums.GoodsAdvertisingEnum;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author Five Team
 * @since 2018-05-15
 */
@Data
@Accessors(chain = true)
@TableName("t_goods_advertising")
public class GoodsAdvertising extends Model<GoodsAdvertising> {

    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 广告标题
     */
    @NotBlank(message = "广告标题不能为空")
    private String title;
    /**
     * 广告图片地址
     */
    private String icon;
    /**
     * 广告类型：富文本、商品链接、
     */
    @NotNull(message = "广告类型不能为空")
    private GoodsAdvertisingEnum type;
    /**
     * 广告内容
     */
    private String content;
    private Date createDate;
    private Date updateDate;
    private String createBy;
    @TableLogic
    private Boolean isDelete;
    private Boolean isEnable;
    private Integer orders;

    public Boolean getDelete() {
        return isDelete;
    }

    public void setDelete(Boolean delete) {
        isDelete = delete;
    }

    public Boolean getEnable() {
        return isEnable;
    }

    public void setEnable(Boolean enable) {
        isEnable = enable;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
